package com.hd.crdao.base;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;

import com.hd.crdao.utils.ActivityManagerUtils;

public abstract class BaseActivity extends FragmentActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        ActivityManagerUtils.addActivity(this);
        super.onCreate(savedInstanceState);

        setContentView(getLayoutId());

        initView();

        initData();

        initListener();

    }

    protected abstract int getLayoutId();

    protected abstract void initView();

    protected abstract void initData();

    protected abstract void initListener();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ActivityManagerUtils.removeActivity(this);
    }
}
